<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        //表格的数据
        var data = [];
        for (var i = 1; i <= 22;i++){
            data.push(i);
        }
        //每页3笔
        var page_num = 3;
        //定义方法 截取对应页的数组内容
        var turnPage = function (page) {
            var reArr = [];

            //如果是3 笔的倍数：(page * page_num)-1 取本身加前两位 结束位置
            //如果不是3笔的倍数：（page - 1) * page_num
            /*
                page
                1       data[page * page_num - 1]    data[2]
                2       data[page * page_num - 1]    data[5]
            */
            var end = page * page_num - 1;
            //data[end - 2];
            //data[end - 1];
            //data[end];

             for (var i=0;i<page_num;i++){
                 if (data[end - 2]){
                     reArr.push(data[end++ - 2]);
                 }
             }
            return reArr;
        };
        //测试
        var result = turnPage(prompt('请输入页数：')-0);
        alert(result);
    </script>
</head>
<body>

</body>
</html>